package com.zhengjiang.nacos.consumer.controller;


import com.zhengjiang.nacos.consumer.model.Order;
import com.zhengjiang.nacos.consumer.service.ProductOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("product")
public class OrderController {

    @Autowired
    private ProductOrderService productOrderService;

    @PostMapping("/order")
    public String order(@RequestBody Order order){
        productOrderService.submitProductOrder(order);
        return "success";
    }
}
